<?php
class Products_model extends CI_Model {

    public function  get_employee(){
           $c = oci_connect('ngtrieuvi92', 'Huynhde92', 'localhost/orcl');
            if (!$c) {
                $m = oci_error();
                trigger_error('Could not connect to database: '. $m['message'], E_USER_ERROR);
            }

           $s = oci_parse($c, "CSELECT * FROM employee");
           
           if (!$s) {
               $m = oci_error($c);
               trigger_error('Could not parse statement: '. $m['message'], E_USER_ERROR);
          } 
         
           $r = oci_execute($s);
           if (!$r) {
               $m = oci_error($s);
               trigger_error('Could not execute statement: '. $m['message'], E_USER_ERROR);
           }
           $r = oci_fetch_all($s, $res);
           if (!$r) {
               $m = oci_error($s);
               trigger_error('Could not fetch rows: '. $m['message'], E_USER_ERROR);
           }
           
 
           $result = array();
           $x = 0;
            foreach ($res as $row) {
               foreach ($row as $item) {
                   echo $item;
                  //$result($x) = $item;
                  $x++;
               }  
           }
         return result;
    }

}